<extend name="Base:main" />
<block name="script">
	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
</block>
<block name="content">
<div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
               订单列表
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">订单管理</a></li>
                <li class="am-active"><?php if($type == 'gh'):?>供货订单列表<?php elseif($type == 'fx'):?>分销订单列表<?php else:?>订单列表<?php endif;?></li>
            </ol>
            <div class="tpl-portlet-components">
               
                <div class="tpl-block">
                    <div class="am-g">
                          <form class="am-form" action="{:U('Goods/index')}" method="get">
                              <input type="hidden" name="c" value="{$Think.const.CONTROLLER_NAME}" class="form-control">
                                <input type="hidden" name="a" value="{$Think.const.ACTION_NAME}" class="form-control">
                                <input type="hidden" name="m" value="{$Think.const.MODULE_NAME}" class="form-control">
                               <div class="am-u-sm-12 am-u-md-5">
                                   
                                  <label class=" am-form-label">订单编号</label> <span style="display: inline-block;"><input type="text"  name="keyword" value="{$sh.keyword}"  class=" am-form-field"></span>
                                  <label class=" am-form-label">&nbsp;&nbsp;&nbsp;订购人</label> <span style="display: inline-block;"><input type="text" name="sku" value="{$sh.sku}" class=" am-form-field"></span>
                                  
                                </div>
                                <div class="am-u-sm-12 am-u-md-2">
                                    <div class="am-form-group">
                                        
                                        <input type="hidden" id="goods_type" value="{$sh.goods_type_id}">
                                          <select name="channel_code">
                                                <option value="">请选择渠道</option>
                                            <volist name="channel_codelist" id="vvv">
                                                <option value="{$vvv.channel_code}" <if condition="$vvv.channel_code eq $sh['channel_code']">selected="selected" </if>>{$vvv.channel_code}</option>
                                            </volist>                                    
                                        </select>
                                    </div>
                                     <div class="am-form-group">
                                        
                                        <input type="hidden" id="goods_type" value="{$sh.goods_type_id}">
                                          <select name="channel_code">
                                                <option value="">请选择渠道</option>
                                            <volist name="channel_codelist" id="vvv">
                                                <option value="{$vvv.channel_code}" <if condition="$vvv.channel_code eq $sh['channel_code']">selected="selected" </if>>{$vvv.channel_code}</option>
                                            </volist>                                    
                                        </select>
                                    </div>
                                </div>
                             
                             
                                <div class="am-u-sm-12 am-u-md-3">
                                    <div class="am-input-group am-input-group-sm">
                                         <button type="submit" class="btn btn-purple btn-sm">
                                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                            Search
                                        </button>
                                    </div>
                                </div>
                          </form>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                          
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                          
                                            <th class="table-check"> <input class="check-all" type="checkbox" value=""></th>
                                            <th class="table-id" width="100px">商品货号</th>
                                            <th class="table-title"  width="260px">商品名称</th>
                                            <th>品牌</th>
                                            <th width="90px">类别</th>
                                            <th class="table-author am-hide-sm-only">市场价格</th>
                                             <th>成本价</th>
                                             <th>销售价格</th>
                                            <th class="table-date am-hide-sm-only">库存</th>
                                            <th>原产国</th>
                                            <th>贸易类型</th>
                                            <th>归属店铺</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                      <volist name="data['list']" id="val">
                                        
                                        <tr>
                                            <td><input class="ids" type="checkbox" name="ids[]" value="{$val['id']}"></td>
                                            <td>{$val.sku}</td>
                                            <td><a href="#">{$val.name}</a></td>
                                            <td>{$val['brand_name']}</td>
                                            <td>{$val['type_name']}</td>
                                            <td class="am-hide-sm-only">{$val.price_market}</td>
                                            <td class="am-hide-sm-only">{$val.price_cost}</td>
                                            <td class="am-hide-sm-only">{$val.price}</td>
                                            <td class="am-hide-sm-only">{$val['stock_num']}</td>
                                             <td>{$val['chinese_name']}<?php if($val['country_enabled']=='true' && $val['chinese_name']):?><i class="ace-icon fa fa-check bigger-100"></i><?php elseif($val['country_enabled']=='true'):?>
                                                <i class="ace-icon  fa fa-times"></i><?php endif;?>
                                            </td>

                                            <td>{$val['trade_type']}{$tradeList[$val['trade_type']]}</td>
                                            <td>{$val['partner_name']}</td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 修改</button>
                                                        <?php if($val['distribution_id'] == $customer_id):?>
                                                        <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span> 支付货款</button>
                                                        <?php endif;?>
                                                        <?php if($val['supply_id'] == $customer_id):?>
                                                        <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span> 发货</button>
                                                        <?php endif;?>
                                                        <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            {$data['page']}
                                        </ul>
                                    </div>
                                </div>
                                <hr>

                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>

        </div>
    <script>
            $(function () {
                var goods_type_id = $('#goods_type').val();
                if(goods_type_id){
                    $('#goods_type_id option').each(function(){
                          if( goods_type_id == $(this).attr('value') ) {
                              $(this).attr('selected' , true);
                              return false;
                          } 
                       }); 
                }
            })
          $(".check-all").click(function () {
            $(".ids").prop("checked", this.checked);
        });
          $(".ids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
       
    </script>
    
</block>